<?php
/**
 * 配置类
 */
class Mgconfig
{
    protected static $config = [];

    protected static $paths = [];

    protected static $basePath = '/config';

    public static function config($name, $default = NULL)
    {
        return (isset(self::$config[$name])) ? self::$config[$name] : $default;
    }

    public static function addPath($path)
    {
        (! in_array($path, self::$paths)) && self::$paths[] = $path;
    }



    public static function loadConfig()
    {
        if (! empty(self::$path)) {

            if (! file_exists(INTERFACE_PATH . self::$basePath)) {
                throw new MgException('config error');
            }
        }
    }
}
?>